begin # simple examples
  puts "Start"
  p = Points.new("graph_1")
  p.add(100, 100)
  p.add(-99, -100)
  p.add(-5, -3)
  p.add(2, 2)
  p.add(15, -24)
  p.add(6, -6)
  p.draw("dev.png")
end

# upsampling and downsampling
=begin
  p1 = Points.new("sin")
  n = 10
  (n + 1).times{|i|
    p1.add((-Math::PI + i*2*Math::PI/n)*50, Math.sin(-Math::PI + i*2*Math::PI/n)*50)
  }

  p11 = p1.upsample

  p12 = p1.downsampe_default

  p13 = p1.downsample_new

  DrawCharts.new("dev.png", p1, p11, p12, p13)
=end

# waveletting
=begin
  p1 = Points.new("sin")
  n = 50
  (n + 1).times{|i|
    p1.add((-Math::PI + i*2*Math::PI/n)*50, Math.sin(-Math::PI + i*2*Math::PI/n)*50)
  }

  general1, wavelet1 = p1.wavelet_decomposition

  general2, wavelet2 = general1.wavelet_decomposition

  general11 = general2.plus_wavelet(wavelet2)

  p12 = general11.plus_wavelet(wavelet1)

  DrawCharts.new("dev.png", p1, general1, general2, general11, p12)
=end

# drawCharts examples
=begin
  p1 = Points.new("sin")
  n = 50
  (n + 1).times{|i|
    p1.add((-Math::PI + i*2*Math::PI/n)*50, Math.sin(-Math::PI + i*2*Math::PI/n)*50)
  }

  n = 100
  p2 = Points.new("cos")
  (n + 1).times{|i|
    p2.add((-Math::PI + i*2*Math::PI/n)*50, Math.cos(-Math::PI + i*2*Math::PI/n)*50)
  }

  n = 200
  p3 = Points.new("hep1")
  (n + 1).times{|i|
    p3.add(-1 - i, 200.0/(-1 - i))
  }

  n = 200
  p4 = Points.new("hep2")
  (n + 1).times{|i|
    p4.add(1 + i, 200.0/(1 + i))
  }

  t1 = p1.deviate(5)

  t2 = t1.deviate(5)

  t3 = t2.deviate(5)

  #p1.draw("sin.png")
  #t2.clear
  DrawCharts.new("dev.png", p1, p2, p3, p4, t1, t2, t3)
=end

=begin
  f1 = Function.new("exp")
  pr1 = f1.create_points([-2, 1], 0.1, "exp_name")
  f2 = Function.new("sin")
  pr2 = f2.create_points([-3, 3], 0.1, "exp_name2")
  DrawCharts.new("dev.png", pr1, pr2)
  pr1.draw("chart.png")
=end